import 'package:taonile/generated/json/base/json_field.dart';
import 'package:taonile/generated/json/banner_for_home_entity.g.dart';
import 'dart:convert';

@JsonSerializable()
class BannerForHomeEntity {
  late int code = 0;
  late String msg;
  late List<BannerForHomeData> data = [];

  BannerForHomeEntity();

  factory BannerForHomeEntity.fromJson(Map<String, dynamic> json) =>
      $BannerForHomeEntityFromJson(json);

  Map<String, dynamic> toJson() => $BannerForHomeEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class BannerForHomeData {
  late String id;
  @JSONField(name: "img_path")
  late String imgPath;
  late String link;
  late String sort;

  BannerForHomeData();

  factory BannerForHomeData.fromJson(Map<String, dynamic> json) => $BannerForHomeDataFromJson(json);

  Map<String, dynamic> toJson() => $BannerForHomeDataToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}
